define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'qq2/index',
        export_url: 'qq2/export',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh', 'export'],
                limit: 100,
                limits: [100,200,300,400,500,600],
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'ID', width: 100, search: false},
                    {field: 'zqq', title: '主QQ'},
                    {field: 'nickname', title: '昵称', search: false},
                    {field: 'qq', title: 'QQ', templet: function (d) {
                            return '<a class="layui-table-cell" data-get="read?id='+ d.id +'" data-qq="'+ d.qq +'" style="text-decoration: underline;cursor: pointer;">' + d.qq + '</a>';
                        }
                    },
                    {field: 'is_read', title: '状态', selectList: {'0':'未跟踪', '1':'已跟踪'}, templet: function (d){
                            if (d.is_read){
                                return '<div class="layui-table-cell" style="color: red;">已跟踪</div>';
                            }
                            return '<div class="layui-table-cell" style="color: green;">未跟踪</div>';
                        }
                    },
                    {field: 'create_time', title: '创建时间', search: 'range'},
                ]],
            });
            ea.listen();
        },
    };
    return Controller;
});